#include "GLAllInOne.h"
#include "Graphic.h"

namespace ManchyGL
{
	void Graphic::ClearColor(float r, float g, float b, float a)
	{
		glClearColor(r, g, b, a);
	}

	void Graphic::Clear(int mask)
	{
		int v = 0;
		if ((mask & Graphic::CLEAR_MASK_COLOR) != 0)
			v |= GL_COLOR_BUFFER_BIT;
		if ((mask & Graphic::CLEAR_MASK_DEPTH) != 0)
			v |= GL_DEPTH_BUFFER_BIT;
		glClear(v);
	}

	void Graphic::Swap(GLFWwindow* window)
	{
		glfwSwapBuffers(window);
	}

	void Graphic::PollEvents()
	{
		glfwPollEvents();
	}

	void Graphic::SetViewport(int x, int y, int width, int height)
	{
		glViewport(x, y, width, height);
	}
}